/*************************************************************************
> File Name: circle.cpp
> Author: hzy
> Created Time: 2023-08-09 19:54:32
> Description:
************************************************************************/
#include "circle.h"
#include "point.h"

void Circle::judgePointInCircle(Point &point)
{
    // 点到圆心的距离的平方
    int distance = (((point.getX() - cp.getX()) * (point.getX() - cp.getX())) + ((point.getY() - cp.getY()) * (point.getY() - cp.getY())));

    // 圆心的平方
    int R = r * r;

    if (distance > R)
    {
        cout << "点在圆外" << endl;
        return;
    }
    if (distance == R)
    {
        cout << "点在圆上" << endl;
        return;
    }
    if (distance < R)
    {
        cout << "点在圆内" << endl;
        return;
    }
}